
#ifndef GKT_CRC16_H
#define GKT_CRC16_H

#include "gkt_types.h"

#define GKT_CRC16_IBM_POLY	0x8005
#define GKT_CRC16_IBM_INIT	0x0000
uint16_t gkt_crc16_ibm(const uint8_t *data, uint32_t length);

#define GKT_CRC16_MAXIM_POLY	0x8005
#define GKT_CRC16_MAXIM_INIT	0x0000
uint16_t gkt_crc16_maxim(const uint8_t *data, uint32_t length);

#define GKT_CRC16_USB_POLY	0x8005
#define GKT_CRC16_USB_INIT	0xFFFF
uint16_t gkt_crc16_usb(const uint8_t *data, uint32_t length);

#define GKT_CRC16_MODBUS_POLY	0x8005
#define GKT_CRC16_MODBUS_INIT	0xFFFF
uint16_t gkt_crc16_modbus(const uint8_t *data, uint32_t length);

#define GKT_CRC16_CCITT_POLY	0x1021
#define GKT_CRC16_CCITT_INIT	0x0000
uint16_t gkt_crc16_ccitt(const uint8_t *data, uint32_t length);

#define GKT_CRC16_CCITT_FALSE_POLY	0x1021
#define GKT_CRC16_CCITT_FALSE_INIT	0xFFFF
uint16_t gkt_crc16_ccitt_false(const uint8_t *data, uint32_t length);

#define GKT_CRC16_X25_POLY	0x1021
#define GKT_CRC16_X25_INIT	0xFFFF
uint16_t gkt_crc16_x25(const uint8_t *data, uint32_t length);

#define GKT_CRC16_XMODEM_POLY	0x1021
#define GKT_CRC16_XMODEM_INIT	0x0000
uint16_t gkt_crc16_xmodem(const uint8_t *data, uint32_t length);

#define GKT_CRC16_DNP_POLY	0x3D65
#define GKT_CRC16_DNP_INIT	0x0000
uint16_t gkt_crc16_dnp(const uint8_t *data, uint32_t length);


#endif	/* GKT_CRC16_H */

